﻿
@{
    ViewBag.Title = Resources.WebStringsWeb.WebTitle;
    Layout = "~/Views/Shared/_LayoutMobile.cshtml";
}

@section css {
    <style>
        .IsException {
            color: red;
        }

        .IsNormal {
            color: blue;
        }

        .mui-bar ~ .mui-content .mui-scroll-wrapper {
            top: 44px;
            height: auto;
        }

        .result_items {
            border: 1px solid rgb(227,227,229);
            position:sticky;
            height: 120px;
            width: 252px;
            top: 40px;
            left: 130px;
            z-index:999;
            background-color: rgb(239, 239, 244, 0.9);
        }
        .result_user {
            position:relative;
            cursor:pointer;
            margin-top:5px;
        }
    </style>
}
<header class="mui-bar mui-bar-nav">
    <a class="mui-icon mui-icon-left-nav mui-pull-left" href="MConstructionPageList"></a>
    <h1 class="mui-title" style="color:white;">危险作业审核</h1>
</header>
<div class="mui-content" ng-cloak ng-controller="ConstructionController" ng-init="
     FormId='@(Request.QueryString["FormId"].IsEmpty() ? "0" : Request.QueryString["FormId"])';
     MGetConstructionCompanyList();
     MGetWorkerList();
     MGetConstructionDetail(FormId);
     GetAllUserList();
     ">
    <form class="mui-input-group">
        <div class="mui-input-row">
            <label>申请部门</label>
            <input type="text" ng-model="Construction.DepartmentName" disabled />
        </div>
        <div class="mui-input-row">
            <label>外协单位</label>
            <select ng-model="Construction.OutCompanyId" class="form-control" disabled>
                <option ng-repeat="x in OutCompanyList" value="{{x.Id}}">{{x.CompanyName}}</option>
            </select>
        </div>
        <div class="mui-input-row">
            <label>作业区域</label>
            <input type="text" placeholder="地点/部位" value="{{Construction.ParkName}}{{Construction.Place}}" disabled />
        </div>
        <div class="mui-input-row">
            <label>作业时间</label>
            <input type="text" placeholder="地点/部位" value="{{Construction.StartTime|JSONDate:'yyyy-MM-dd HH:mm'}} 至 {{Construction.EndTime|JSONDate:'MM-dd HH:mm'}}" disabled />
        </div>
        <div class="mui-input-row">
            <label>作业类型</label>
            <input type="text" value="{{Construction.TypeName}}{{Construction.OtherType}}" disabled />
        </div>
        <div class="mui-input-row">
            <label>危险等级</label>
            <input type="text" value="{{Construction.LevelName}}" disabled />
        </div>
        <div class="mui-input-row">
            <label>作业事由</label>
            <input type="text" value="{{Construction.Reason}}" disabled />
        </div>
    </form>

    <h5 style="margin-top:20px;">
        &nbsp;&nbsp;&nbsp;&nbsp;作业环境风险辨识
    </h5>

    <form class="mui-input-group">
        <div class="mui-input-row mui-checkbox mui-left" ng-repeat="x in RiskList">
            <label>{{x.RiskContent}}</label>
            <input name="chkrisk" type="checkbox" id="risk_{{x.Id}}" disabled>
        </div>
        <div class="mui-input-row mui-checkbox mui-left" ng-show="Construction.OtherRisk!=null">
            <input type="text" value="{{Construction.OtherRisk}}" disabled>
        </div>
    </form>

    <h5 style="margin-top:20px;">
        &nbsp;&nbsp;&nbsp;&nbsp;安全防控措施
    </h5>

    <form class="mui-input-group">
        <div class="mui-input-row mui-checkbox mui-left" ng-repeat="x in SolutionList">
            <label>{{x.SolutionContent}}</label>
            <input name="chksolution" type="checkbox" id="solution_{{x.Id}}" disabled>
        </div>
        <div class="mui-input-row mui-checkbox mui-left">
            <input type="text" value="{{Construction.OtherSolution}}" disabled>
        </div>
    </form>

    <h5 style="margin-top:20px;">
        &nbsp;&nbsp;&nbsp;&nbsp;安全设施设备
    </h5>

    <form class="mui-input-group">
        <div class="mui-input-row mui-checkbox mui-left" ng-repeat="x in EquList">
            <label>{{x.EquName}}</label>
            <input name="chkequ" type="checkbox" id="equ_{{x.Id}}" disabled>
        </div>
        <div class="mui-input-row mui-checkbox mui-left" ng-show="Construction.OtherSafetyEqu!=null">
            <input type="text" value="{{Construction.OtherSafetyEqu}}" disabled>
        </div>
    </form>
    <div class="title">
        附件
    </div>
    <ul class="mui-table-view">
        <li class="mui-table-view-cell" ng-repeat="f in Construction.FileList"><a style="display:block;" ng-href="../Download/DownloadFile?FileId={{f.FileId}}">{{f.FileName}}</a></li>
    </ul>
    <div class="title">
        {{Construction.GetStatusDetail.OperateName}}
    </div>
    <form class="mui-input-group" ng-init="ApproveModel.ApproveTime='@DateTime.Now.ToString("yyyy-MM-dd HH:mm")';ApproveModel.Id=FormId;">
        <div class="mui-input-row">
            <label>审核人</label>
            <input type="text" placeholder="地点/部位" value="{{User.UserName}}" disabled />
        </div>
        <div class="mui-input-row">
            <label>审核时间</label>
            <input type="text" value="@DateTime.Now.ToString("MM-dd HH:mm")" disabled />
        </div>
        <div class="mui-input-row" ng-tap="MShowTip(Construction.ApproveNodeDescription)">
            <label>审核节点</label>
            <input type="text" value="{{Construction.ApproveNodeDescription}}" disabled />
        </div>
        <div class="mui-input-row">
            <label>下节点审核</label>
            <select ng-model="ApproveModel.NextStatus" ng-change="IsShowChooseUser(ApproveModel.NextStatus,Construction.ApproveNodes);">
                <option selected value="">请选择</option>
                <option ng-repeat="x in Construction.ApproveNodes" value="{{x.NextStatus}}">{{x.StatusName}}</option>
            </select>
        </div>
        <div class="mui-input-row" ng-show="IsShowChoose" style="overflow:visible;">
            <label>下节点审核人</label>
            <input type="text" ng-model="name" ng-change="GetUserByName(name);" />

        </div>
        <div class="result_items" ng-show="resultlist!=null && resultlist.length>0">
            <div class="result_user" ng-repeat="x in resultlist" ng-click="selectuser(x);">{{x.UserNo}}-{{x.UserName}}</div>
        </div>
    </form>



    <h5>
        &nbsp;&nbsp;&nbsp;&nbsp;审核意见
    </h5>

    <textarea id="textarea" rows="5" ng-model="ApproveModel.Remark"></textarea>
    <div class="mui-button-row" style="margin-top:50px;">
        <button type="button" ng-click="MApproveConstruction(ApproveModel,true);" ng-disabled="Loading" class="mui-btn mui-btn-primary mui-btn-block">同 &nbsp;&nbsp;意</button>
        <button type="button" ng-click="MApproveConstruction(ApproveModel,false);" ng-disabled="Loading" class="mui-btn mui-btn-success mui-btn-block">驳 &nbsp;&nbsp;回</button>
    </div>
    <div style="height:100px;"></div>
</div>
@section js{
    <script src="~/Assets/js/mui.pullToRefresh.js"></script>
    <script src="~/Assets/js/mui.pullToRefresh.material.js"></script>
    <script src="~/Assets/js/pg/Construction.js?v=@DateTime.Now.ToString("yyyyMMddHHmm")"></script>

    <script>
        mui.init({
            swipeBack: false,
            keyEventBind: {
                backbutton: false  //关闭back按键监听
            }
        });
    </script>
}